package com.ssy.lingxi.after.sale.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 退货动作枚举
 * @author ds
 * @date 2021/5/24
 * @version 2.0.0
 */
public enum ReturnGoodsActionEnum {
    SUBMIT(1, "提交退货申请单"),
    CONFIRM(2,"确认退货申请单"),
    SEND_GOODS(3,"退货发货"),
    RECEIVING_GOODS(4,"退货收货"),
    CONFIRM_RECEIPT(5,"确认退货回单"),
    MONEY_BACK(6,"退款"),
    CONFIRM_MONEY_BACK(7,"确认退款到账"),
    CONFIRM_COMPLETE(8,"确认售后完成"),
    ADD_RETURN_SEND_GOODS(9, "新增退货发货单"),
    ADD_LOGISTICS(10,"新增物流单"),
    ADD_IN_STORAGE(11,"新增退货入库单"),

    INNER_SUBMIT_VALIFY(51,"提交审核退货申请单"),
    INNER_VALIFY(52,"审核退货申请单"),
    INNER_CONFIRM(53,"确认退货申请单"),
    //平台确认
    PLATFORM_CONFIRM(54,"确认退货申请单"),


    ;
    private final Integer code;
    private final String message;

    ReturnGoodsActionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getDeclaringClass(), this.getCode());

    }

    public static String getMessage(Integer code) {
        ReturnGoodsActionEnum item = Arrays.stream(ReturnGoodsActionEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return null != item ? item.getMessage() : "";
    }
}